package com.example.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.web.firewall.HttpFirewall;
import org.springframework.security.web.firewall.StrictHttpFirewall;

/**
 * <h1></h1>
 * Created by hanqf on 2021/7/13 18:18.
 */

@Configuration
public class Securityconfig {

    // org.springframework.security.web.firewall.RequestRejectedException:
    // The request was rejected because the URL contained a potentially malicious String ";"
    @Bean
    public HttpFirewall allowUrlSemicolonHttpFirewall() {
        StrictHttpFirewall firewall = new StrictHttpFirewall();
        firewall.setAllowSemicolon(true);
        return firewall;
    }
}
